home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
winter_challenge.swf
/
scripts
/
frame_115
/
PlaceObject2_244_124
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2011-08-19
|
1KB
|
32 lines
onClipEvent(enterFrame){
if(_root.gameInProgress == 1)
{
rot = Math.atan2(_root.ATVclip._y - this._y,_root.ATVclip._x - this._x);
rotNum = rot * 360 / 6.283185307179586;
this._rotation = rotNum;
i++;
if(i > 10 + random(50) && _root.gameInProgress == 1)
{
_root.ball._visible = 1;
duplicateMovieClip(_root.ball,"newball2",16384 + (8100 + i));
var hyp = 35;
_root.newball2.pathRadius = 35;
_root.newball2.degrees = rotNum;
with(Math)
{
radians = _root.newball2.degrees * (PI / 180);
yCoor = hyp * Math.sin(radians);
xCoor = hyp * Math.cos(radians);
}
_root.newball2._x = this._x + xCoor;
_root.newball2._y = this._y + yCoor;
_root.newball2.targetX = _root.ATVclip._x;
_root.newball2.targetY = _root.ATVclip._y;
i = 1;
_root.CANNON_F.start(0,0);
this.play();
_root.ball._visible = 0;
}
}
}